package xyz.weizhi.tanhua.autoconfig.propreties;
import com.aliyun.teaopenapi.models.*;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Author milian
 * @Date 2021/10/22 0022 20:58
 */
@Data
@ConfigurationProperties(prefix = "tanhua.facebody")
@Configuration
public class FacebodyProperties {
    private String AccessKeyId;
    private String AccessKeySecret;
    @Bean
    public com.aliyun.facebody20191230.Client Client() throws Exception {
        Config config = new Config()
                // 您的AccessKey ID
                .setAccessKeyId(AccessKeyId)
                // 您的AccessKey Secret
                .setAccessKeySecret(AccessKeySecret);
        // 访问的域名
        config.endpoint = "facebody.cn-shanghai.aliyuncs.com";
        return new com.aliyun.facebody20191230.Client(config);
    }
}
